package alex.game.state
{
	
	import alex.game.playerIO.PlayerIOManager;
	
	import com.framework.BasicState;
	import com.framework.GG;
	import com.framework.IUpdatable;
	import com.framework.util.Log;
	
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	
	public class AccueilState extends BasicState
	{
		private var affichage:MovieClip;
		private var graph:MovieClip;
		
		public function AccueilState()
		{
			
		}
		override public function create():void
		{
			PlayerIOManager.getInstance().clean();
			display();
			setListeners();
		}
		override public function destroy():void
		{
			this.affichage.bt_play.removeEventListener(MouseEvent.CLICK, bt_play_clicked);
			
			super.destroy();
		}
		private function display():void
		{
			//this.affichage = new STATE_ACCUEIL;
			this.addChild(affichage);
		}
		private function setListeners():void
		{
			this.affichage.bt_play.addEventListener(MouseEvent.CLICK, bt_play_clicked);
		}
		private function bt_play_clicked(e:MouseEvent):void
		{
			if(!GG.isSwitching){
				Log.debug(this,"Play clicked");
				GG.switchState(new LoginState());
			}
		}
	}
}